package com.ben.chatroom.feignClient;

import com.ben.chatroom.common.constants.ServerConstants;
import com.ben.chatroom.common.entity.LoginBack;
import com.ben.chatroom.common.util.JsonUtil;
import feign.Feign;
import feign.codec.StringDecoder;

/**
 * @author huangyijun
 */
public class WebOperator {

  public static LoginBack login(String userName, String password) {
    UserAction action = Feign
      .builder()
      .decoder(new StringDecoder())
      .target(UserAction.class, ServerConstants.WEB_URL);
    String s = action.loginAction(userName, password);

    return JsonUtil.jsobToPojo(s, LoginBack.class);
  }

}
